<?php
class Productmodel extends Model {
	function Productmodel() {
		parent::Model();
	}
	function show_product() {
		$this->db->select ('*');
		$this->db->from('product');
		$this->db->order_by('prod_id','desc');
		$this->db->limit('1');
		
		return $this->db->get();
	}
	
	function insert_product($insertProduct) {
		$this->db->insert('product',$insertProduct);
	}
	function select_all_product() {
		$this->db->select('*');
		$this->db->from('product');
		$this->db->order_by('prod_id','desc');
		
		return $this->db->get();
	}
	function delete_product($prod_id) {
		$this->db->where('prod_id',$prod_id);
		$this->db->delete('product');
		
		
		//return $this->db->get();
	}
	function update_product($prod_id,$table) {
		$this->db->where('prod_id',$prod_id);
		$this->db->update('product',$table);
	}
	function get_idprod($id) {
		$this->db->select('*');
		$this->db->from('product');
		$this->db->where('prod_id',$id);
		
		return $this->db->get();
	}
}
?>